#### Replication for "Enhancing Public Support for International Sanctions: An Information Provision Experiment"
#### Authors: Kantorowicz, Jaroslaw, & Elena Kantorowicz-Reznichenko
#### Published in European Journal of Political Research

# Loading packages

library(sjPlot)
library(stargazer)
library(tidyverse)
library(ggsci)
library(stargazer)
library(vtable)
library(ggrain)

# Loading the data

de <- readRDS("Germany_replication.rds")

pl <- readRDS("Poland_replication.RDS")

### Cost perception

#### Cost perception: Regression table (A4) and t-tests

pl_cost <- lm(formula = cost_info_provision ~ treatment_information_provision, 
              data = pl,
              weights = weight)

t.test(formula = cost_info_provision ~ treatment_information_provision,
       data = pl[pl$treatment_information_provision=="Control" |
                   pl$treatment_information_provision=="Information",])

de_cost <- lm(formula = cost_info_provision ~ treatment_information_provision, 
              data = de,
              weights = weight)

t.test(formula = cost_info_provision ~ treatment_information_provision,
       data = de[de$treatment_information_provision=="Control" |
                   de$treatment_information_provision=="Information",])

stargazer(pl_cost, de_cost,
          type = "html",
          out = "cost.doc",
          title = "Regression Table",
          style = "qje",
          dep.var.labels = c("Perception of costs"),
          covariate.labels = c("Information",
                               "Information + Covid-19",
                               "Information + Russia"))

#### Cost perception: Figure 1

pl_cost_retrieve <- plot_model(pl_cost, type = "pred")

pl_cost_df <- data.frame(level = pl_cost_retrieve[["plot_env"]][["x_lab"]],
                         estimate = pl_cost_retrieve[["data"]][["predicted"]],
                         lower = pl_cost_retrieve[["data"]][["conf.low"]],
                         higher = pl_cost_retrieve[["data"]][["conf.high"]],
                         country = "Poland")

de_cost_retrieve <- plot_model(de_cost, type = "pred")

de_cost_df <- data.frame(level = de_cost_retrieve[["plot_env"]][["x_lab"]],
                         estimate = de_cost_retrieve[["data"]][["predicted"]],
                         lower = de_cost_retrieve[["data"]][["conf.low"]],
                         higher = de_cost_retrieve[["data"]][["conf.high"]],
                         country = "Germany")

cost <- bind_rows(pl_cost_df, de_cost_df)

ggplot(cost,
       mapping = aes(x = estimate,
                     y = level,
                     xmin = lower,
                     xmax = higher)) +
  theme_bw() +
  geom_pointrange(aes(group = country,
                      color = country,
                      shape = country),
                  position = position_dodge(width = 0.5), size = 0.3) +
  theme(legend.position = "top") +
  labs(x = "Perceived costs of sanctions", 
       y = "", 
       color = "Country",
       shape = "Country") +
  geom_vline(xintercept = 0.0, color = "gray") +
  scale_color_manual(values = c("#00008b", "maroon"))  +
  scale_x_continuous(breaks=seq(1,7,1)) +
  xlim(1,7) +
  coord_flip() +
  geom_vline(xintercept = 4.2588, color = "maroon", linetype="dotted") +
  geom_vline(xintercept = 4.62548, color = "#00008b", linetype="dotted") +
  scale_shape_manual(values=c(16, 15)) 

ggsave("costs.jpg",
       height = 8,
       width = 8,
       scale = 0.5)

### Support for sanctions

#### Support for sanctions: Regression table (A5) and t-tests

pl_support <- lm(formula = support_info_provision ~ treatment_information_provision, 
                 data = pl,
                 weights = weight)

t.test(formula = support_info_provision ~ treatment_information_provision,
       data = pl[pl$treatment_information_provision=="Control" |
                   pl$treatment_information_provision=="Information",])

de_support <- lm(formula = support_info_provision ~ treatment_information_provision, 
                 data = de,
                 weights = weight)

t.test(formula = support_info_provision ~ treatment_information_provision,
       data = de[de$treatment_information_provision=="Control" |
                   de$treatment_information_provision=="Information",])

stargazer(pl_support, de_support,
          type = "html",
          out = "support.doc",
          title = "Regression Table",
          style = "qje",
          dep.var.labels = c("Support for sanctions"),
          covariate.labels = c("Information",
                               "Information + Covid-19",
                               "Information + Russia"))


#### Support for sanctions: Figure 1

pl_support_retrieve <- plot_model(pl_support, type = "pred")

pl_sanctions_df <- data.frame(level = pl_support_retrieve[["plot_env"]][["x_lab"]],
                              estimate = pl_support_retrieve[["data"]][["predicted"]],
                              lower = pl_support_retrieve[["data"]][["conf.low"]],
                              higher = pl_support_retrieve[["data"]][["conf.high"]],
                              country = "Poland")

de_sanctions_retrieve <- plot_model(de_support, type = "pred")

de_sanctions_df <- data.frame(level = de_sanctions_retrieve[["plot_env"]][["x_lab"]],
                              estimate = de_sanctions_retrieve[["data"]][["predicted"]],
                              lower = de_sanctions_retrieve[["data"]][["conf.low"]],
                              higher = de_sanctions_retrieve[["data"]][["conf.high"]],
                              country = "Germany")

sanctions <- bind_rows(pl_sanctions_df, de_sanctions_df)

ggplot(sanctions,
       mapping = aes(x = estimate,
                     y = level,
                     xmin = lower,
                     xmax = higher)) +
  theme_bw() +
  geom_pointrange(aes(group = country,
                      color = country,
                      shape = country),
                  position = position_dodge(width = 0.5), size = 0.3) +
  theme(legend.position = "top") +
  labs(x = "Support for sanctions", 
       y = "", 
       color = "Country",
       shape = "Country") +
  geom_vline(xintercept = 0.0, color = "gray") +
  scale_color_manual(values = c("#00008b", "maroon"))  +
  scale_x_continuous(breaks=seq(1,7,1)) +
  xlim(1,7) +
  coord_flip() +
  geom_vline(xintercept = 4.97280, color = "maroon", linetype="dotted") +
  geom_vline(xintercept = 4.1008, color = "#00008b", linetype="dotted") +
  scale_shape_manual(values=c(16, 15)) 

ggsave("sanctions.jpg",
       height = 8,
       width = 8,
       scale = 0.5)

### Willingness to do tasks

#### Willingness to do tasks: Regression table (A6) and t-tests

pl_tasks <- lm(formula = effort_task ~ treatment_information_provision, 
               data = pl,
               weights = weight)

de_tasks <- lm(formula = effort_task ~ treatment_information_provision, 
               data = de,
               weights = weight)

stargazer(pl_tasks, de_tasks,
          type = "html",
          out = "tasks.doc",
          title = "Regression Table",
          style = "qje",
          dep.var.labels = c("Willingness to perform tasks"),
          covariate.labels = c("Information",
                               "Information + Covid-19",
                               "Information + Russia"))

#### Willingness to do tasks: Figure 2

pl_tasks_retrieve <- plot_model(pl_tasks, type = "pred")

pl_tasks_df <- data.frame(level = pl_tasks_retrieve[["plot_env"]][["x_lab"]],
                          estimate = pl_tasks_retrieve[["data"]][["predicted"]],
                          lower = pl_tasks_retrieve[["data"]][["conf.low"]],
                          higher = pl_tasks_retrieve[["data"]][["conf.high"]],
                          country = "Poland")

de_tasks_retrieve <- plot_model(de_tasks, type = "pred")

de_tasks_df <- data.frame(level = de_tasks_retrieve[["plot_env"]][["x_lab"]],
                          estimate = de_tasks_retrieve[["data"]][["predicted"]],
                          lower = de_tasks_retrieve[["data"]][["conf.low"]],
                          higher = de_tasks_retrieve[["data"]][["conf.high"]],
                          country = "Germany")

tasks <- bind_rows(pl_tasks_df, de_tasks_df)

ggplot(tasks,
       mapping = aes(x = estimate,
                     y = level,
                     xmin = lower,
                     xmax = higher)) +
  theme_bw() +
  geom_pointrange(aes(group = country,
                      color = country,
                      shape = country),
                  position = position_dodge(width = 0.5), size = 0.3) +
  theme(legend.position = "top") +
  labs(x = "Number of tasks willing to complete", 
       y = "", 
       color = "Country",
       shape = "Country") +
  #geom_vline(xintercept = 0.0, color = "gray") +
  scale_color_manual(values = c("#00008b", "maroon"))  +
  scale_x_continuous(breaks=seq(0,3,1)) +
  xlim(0,3) +
  coord_flip() +
  geom_vline(xintercept = 2.11654, color = "maroon", linetype="dotted") +
  geom_vline(xintercept = 2.09032, color = "#00008b", linetype="dotted") +
  scale_shape_manual(values=c(16, 15)) 

ggsave("tasks.jpg",
       height = 8,
       width = 8,
       scale = 0.5)

### Share of tasks completed correctly

#### Share of tasks completed correctly: Regression table (A7) and t-tests

pl_correct <- lm(formula = tasks_correct ~ treatment_information_provision, 
                 data = pl,
                 weights = weight)

de_correct <- lm(formula = tasks_correct ~ treatment_information_provision, 
                 data = de,
                 weights = weight)

stargazer(pl_correct, de_correct,
          type = "html",
          out = "correct.doc",
          title = "Regression Table",
          style = "qje",
          dep.var.labels = c("Share of tasks completed correctly"),
          covariate.labels = c("Information",
                               "Information + Covid-19",
                               "Information + Russia"))

#### Share of tasks completed correctly: Figure 2

pl_correct_retrieve <- plot_model(pl_correct, type = "pred")

pl_correct_df <- data.frame(level = pl_correct_retrieve[["plot_env"]][["x_lab"]],
                            estimate = pl_correct_retrieve[["data"]][["predicted"]],
                            lower = pl_correct_retrieve[["data"]][["conf.low"]],
                            higher = pl_correct_retrieve[["data"]][["conf.high"]],
                            country = "Poland")

de_correct_retrieve <- plot_model(de_correct, type = "pred")

de_correct_df <- data.frame(level = de_correct_retrieve[["plot_env"]][["x_lab"]],
                            estimate = de_correct_retrieve[["data"]][["predicted"]],
                            lower = de_correct_retrieve[["data"]][["conf.low"]],
                            higher = de_correct_retrieve[["data"]][["conf.high"]],
                            country = "Germany")

correct <- bind_rows(pl_correct_df, de_correct_df)

ggplot(correct,
       mapping = aes(x = estimate,
                     y = level,
                     xmin = lower,
                     xmax = higher)) +
  theme_bw() +
  geom_pointrange(aes(group = country,
                      color = country,
                      shape = country),
                  position = position_dodge(width = 0.5), size = 0.3) +
  theme(legend.position = "top") +
  labs(x = "Share of tasks completed correctly", 
       y = "", 
       color = "Country",
       shape = "Country") +
  #geom_vline(xintercept = 0.0, color = "gray") +
  scale_color_manual(values = c("#00008b", "maroon"))  +
  scale_x_continuous(breaks=seq(0,1,0.2)) +
  xlim(0,1) +
  coord_flip() +
  geom_vline(xintercept = 0.50791, color = "maroon", linetype="dotted") +
  geom_vline(xintercept = 0.455633, color = "#00008b", linetype="dotted") +
  scale_shape_manual(values=c(16, 15)) 

ggsave("correct.jpg",
       height = 8,
       width = 8,
       scale = 0.5)

### Supplementary material

#### Quotas: Table A1

st(de[!is.na(de$weight),],
   vars = c("gender_cat",
            "age_cat",
            "education_cat",
            "region_cat"))

st(pl[!is.na(pl$weight),],
   vars = c("gender_cat",
            "age_cat",
            "education_cat",
            "region_cat"))

#### Distribution of GDP loss estimations

##### Regression table: Table A3

anchor_estimation_pl <- lm(formula = estimation ~ treatment_anchor, data = pl)

anchor_estimation_de <- lm(formula = estimation ~ treatment_anchor, data = de)

summary(anchor_estimation_de)

stargazer(anchor_estimation_pl, anchor_estimation_de,
          type = "html",
          out = "anchors.doc",
          title = "Regression Table",
          style = "qje",
          dep.var.labels = c("Estimation of the GDP loss"),
          covariate.labels = c("No anchor"))

##### Figure A2

ggplot(data = de) +
  geom_density(aes(x = estimation, color = treatment_anchor), 
               position = "identity", alpha = 0.5, adjust = 2) + 
  theme_classic() +
  scale_y_continuous(name = "%", labels=scales::percent) +
  labs(x = "Sanction estimation") +
  scale_color_aaas(name = "Treatment")

ggsave("de_sanction_estimation.jpg",
       height = 8,
       width = 12,
       scale = 0.5)

ggplot(data = pl) +
  geom_density(aes(x = estimation, color = treatment_anchor), 
               position = "identity", alpha = 0.5, adjust = 2) + 
  theme_classic() +
  scale_y_continuous(name = "%", labels=scales::percent) +
  labs(x = "Sanction estimation") +
  scale_color_aaas(name = "Treatment")

ggsave("pl_sanction_estimation.jpg",
       height = 8,
       width = 12,
       scale = 0.5)

#### Robustness checks: only respondents overestimating the costs

#### Preserve only these respondents who overestimate the costs

pl$pkb <- as.numeric(pl$pkb)
pl$pkb_plus <- as.numeric(pl$pkb_plus)

pl_rob <- pl %>% mutate(pkb_all = ifelse(!is.na(pkb), pkb,
                                         ifelse(!is.na(pkb_plus), pkb_plus, NA))) %>% 
  filter(pkb_all>1) %>% drop_na(pkb_all)

de$pkb <- as.numeric(de$pkb)
de$pkb_plus <- as.numeric(de$pkb_plus)

de_rob <- de %>% mutate(pkb_all = ifelse(!is.na(pkb), pkb,
                                         ifelse(!is.na(pkb_plus), pkb_plus, NA))) %>% 
  filter(pkb_all>3) %>% drop_na(pkb_all)

### Robustness: Cost perception

#### Robustness: Cost perception - Regression table (A8) and t-tests

pl_cost <- lm(formula = cost_info_provision ~ treatment_information_provision, 
              data = pl_rob,
              weights = weight)

t.test(formula = cost_info_provision ~ treatment_information_provision,
       data = pl_rob[pl_rob$treatment_information_provision=="Control" |
                       pl_rob$treatment_information_provision=="Information",])

t.test(formula = cost_info_provision ~ treatment_information_provision,
       data = pl_rob[pl_rob$treatment_information_provision=="Information \n + COVID-19" |
                       pl_rob$treatment_information_provision=="Information",])

t.test(formula = cost_info_provision ~ treatment_information_provision,
       data = pl_rob[pl_rob$treatment_information_provision=="Information \n + Russia" |
                       pl_rob$treatment_information_provision=="Information",])

de_cost <- lm(formula = cost_info_provision ~ treatment_information_provision, 
              data = de_rob,
              weights = weight)

t.test(formula = cost_info_provision ~ treatment_information_provision,
       data = de_rob[de_rob$treatment_information_provision=="Control" |
                       de_rob$treatment_information_provision=="Information",])

t.test(formula = cost_info_provision ~ treatment_information_provision,
       data = de_rob[de_rob$treatment_information_provision=="Information \n + COVID-19" |
                       de_rob$treatment_information_provision=="Information",])

t.test(formula = cost_info_provision ~ treatment_information_provision,
       data = de_rob[de_rob$treatment_information_provision=="Information \n + Russia" |
                       de_rob$treatment_information_provision=="Information",])

stargazer(pl_cost, de_cost,
          type = "html",
          out = "cost_rob.doc",
          title = "Regression Table",
          style = "qje",
          dep.var.labels = c("Perception of costs"),
          covariate.labels = c("Information",
                               "Information + Covid-19",
                               "Information + Russia"))

#### Robustness: Cost perception - Figure A7

pl_cost_retrieve <- plot_model(pl_cost, type = "pred")

pl_cost_df <- data.frame(level = pl_cost_retrieve[["plot_env"]][["x_lab"]],
                         estimate = pl_cost_retrieve[["data"]][["predicted"]],
                         lower = pl_cost_retrieve[["data"]][["conf.low"]],
                         higher = pl_cost_retrieve[["data"]][["conf.high"]],
                         country = "Poland")

de_cost_retrieve <- plot_model(de_cost, type = "pred")

de_cost_df <- data.frame(level = de_cost_retrieve[["plot_env"]][["x_lab"]],
                         estimate = de_cost_retrieve[["data"]][["predicted"]],
                         lower = de_cost_retrieve[["data"]][["conf.low"]],
                         higher = de_cost_retrieve[["data"]][["conf.high"]],
                         country = "Germany")

cost <- bind_rows(pl_cost_df, de_cost_df)

ggplot(cost,
       mapping = aes(x = estimate,
                     y = level,
                     xmin = lower,
                     xmax = higher)) +
  theme_bw() +
  geom_pointrange(aes(group = country,
                      color = country,
                      shape = country),
                  position = position_dodge(width = 0.5), size = 0.3) +
  theme(legend.position = "top") +
  labs(x = "Perceived costs of sanctions", 
       y = "", 
       color = "Country",
       shape = "Country") +
  geom_vline(xintercept = 0.0, color = "gray") +
  scale_color_manual(values = c("#00008b", "maroon"))  +
  scale_x_continuous(breaks=seq(1,7,1)) +
  xlim(1,7) +
  coord_flip() +
  geom_vline(xintercept = 4.4528, color = "maroon", linetype="dotted") +
  geom_vline(xintercept = 4.8441, color = "#00008b", linetype="dotted") +
  scale_shape_manual(values=c(16, 15)) 

ggsave("costs_rob.jpg",
       height = 8,
       width = 8,
       scale = 0.5)

### Robustness: Support for sanctions

#### Robustness: Support for sanctions - Regression table (A9) and t-tests

pl_support <- lm(formula = support_info_provision ~ treatment_information_provision, 
                 data = pl_rob,
                 weights = weight)

t.test(formula = support_info_provision ~ treatment_information_provision,
       data = pl_rob[pl_rob$treatment_information_provision=="Control" |
                       pl_rob$treatment_information_provision=="Information",])

t.test(formula = support_info_provision ~ treatment_information_provision,
       data = pl_rob[pl_rob$treatment_information_provision=="Information \n + COVID-19" |
                       pl_rob$treatment_information_provision=="Information",])

t.test(formula = support_info_provision ~ treatment_information_provision,
       data = pl_rob[pl_rob$treatment_information_provision=="Information \n + Russia" |
                       pl_rob$treatment_information_provision=="Information",])

de_support <- lm(formula = support_info_provision ~ treatment_information_provision, 
                 data = de_rob,
                 weights = weight)

t.test(formula = support_info_provision ~ treatment_information_provision,
       data = de_rob[de_rob$treatment_information_provision=="Control" |
                       de_rob$treatment_information_provision=="Information",])

t.test(formula = support_info_provision ~ treatment_information_provision,
       data = de_rob[de_rob$treatment_information_provision=="Information \n + COVID-19" |
                       de_rob$treatment_information_provision=="Information",])

t.test(formula = support_info_provision ~ treatment_information_provision,
       data = de_rob[de_rob$treatment_information_provision=="Information \n + Russia" |
                       de_rob$treatment_information_provision=="Information",])

stargazer(pl_support, de_support,
          type = "html",
          out = "support_rob.doc",
          title = "Regression Table",
          style = "qje",
          dep.var.labels = c("Support for sanctions"),
          covariate.labels = c("Information",
                               "Information + Covid-19",
                               "Information + Russia"))

### Robustness: Support for sanctions - Figure A8

pl_support_retrieve <- plot_model(pl_support, type = "pred")

pl_sanctions_df <- data.frame(level = pl_support_retrieve[["plot_env"]][["x_lab"]],
                              estimate = pl_support_retrieve[["data"]][["predicted"]],
                              lower = pl_support_retrieve[["data"]][["conf.low"]],
                              higher = pl_support_retrieve[["data"]][["conf.high"]],
                              country = "Poland")

de_sanctions_retrieve <- plot_model(de_support, type = "pred")

de_sanctions_df <- data.frame(level = de_sanctions_retrieve[["plot_env"]][["x_lab"]],
                              estimate = de_sanctions_retrieve[["data"]][["predicted"]],
                              lower = de_sanctions_retrieve[["data"]][["conf.low"]],
                              higher = de_sanctions_retrieve[["data"]][["conf.high"]],
                              country = "Germany")

sanctions <- bind_rows(pl_sanctions_df, de_sanctions_df)

ggplot(sanctions,
       mapping = aes(x = estimate,
                     y = level,
                     xmin = lower,
                     xmax = higher)) +
  theme_bw() +
  geom_pointrange(aes(group = country,
                      color = country,
                      shape = country),
                  position = position_dodge(width = 0.5), size = 0.3) +
  theme(legend.position = "top") +
  labs(x = "Support for sanctions", 
       y = "", 
       color = "Country",
       shape = "Country") +
  geom_vline(xintercept = 0.0, color = "gray") +
  scale_color_manual(values = c("#00008b", "maroon"))  +
  scale_x_continuous(breaks=seq(1,7,1)) +
  xlim(1,7) +
  coord_flip() +
  geom_vline(xintercept = 4.88481, color = "maroon", linetype="dotted") +
  geom_vline(xintercept = 4.0647, color = "#00008b", linetype="dotted") +
  scale_shape_manual(values=c(16, 15)) 

ggsave("sanctions_rob.jpg",
       height = 8,
       width = 8,
       scale = 0.5)

### Willingness to do tasks

#### Robustness: Willingness to do tasks - Regression table (A10) and t-tests

pl_tasks <- lm(formula = effort_task ~ treatment_information_provision, 
               data = pl_rob,
               weights = weight)

de_tasks <- lm(formula = effort_task ~ treatment_information_provision, 
               data = de_rob,
               weights = weight)

stargazer(pl_tasks, de_tasks,
          type = "html",
          out = "tasks_rob.doc",
          title = "Regression Table",
          style = "qje",
          dep.var.labels = c("Willingness to perform tasks"),
          covariate.labels = c("Information",
                               "Information + Covid-19",
                               "Information + Russia"))

#### Robustness: Willingness to do tasks - Figure A9

pl_tasks_retrieve <- plot_model(pl_tasks, type = "pred")

pl_tasks_df <- data.frame(level = pl_tasks_retrieve[["plot_env"]][["x_lab"]],
                          estimate = pl_tasks_retrieve[["data"]][["predicted"]],
                          lower = pl_tasks_retrieve[["data"]][["conf.low"]],
                          higher = pl_tasks_retrieve[["data"]][["conf.high"]],
                          country = "Poland")

de_tasks_retrieve <- plot_model(de_tasks, type = "pred")

de_tasks_df <- data.frame(level = de_tasks_retrieve[["plot_env"]][["x_lab"]],
                          estimate = de_tasks_retrieve[["data"]][["predicted"]],
                          lower = de_tasks_retrieve[["data"]][["conf.low"]],
                          higher = de_tasks_retrieve[["data"]][["conf.high"]],
                          country = "Germany")

tasks <- bind_rows(pl_tasks_df, de_tasks_df)

ggplot(tasks,
       mapping = aes(x = estimate,
                     y = level,
                     xmin = lower,
                     xmax = higher)) +
  theme_bw() +
  geom_pointrange(aes(group = country,
                      color = country,
                      shape = country),
                  position = position_dodge(width = 0.5), size = 0.3) +
  theme(legend.position = "top") +
  labs(x = "Number of tasks willing to complete", 
       y = "", 
       color = "Country",
       shape = "Country") +
  #geom_vline(xintercept = 0.0, color = "gray") +
  scale_color_manual(values = c("#00008b", "maroon"))  +
  scale_x_continuous(breaks=seq(0,3,1)) +
  xlim(0,3) +
  coord_flip() +
  geom_vline(xintercept = 2.12028, color = "maroon", linetype="dotted") +
  geom_vline(xintercept = 2.07838, color = "#00008b", linetype="dotted") +
  scale_shape_manual(values=c(16, 15)) 

ggsave("tasks_rob.jpg",
       height = 8,
       width = 8,
       scale = 0.5)

### Share of tasks completed correctly

#### Robustness: Share of tasks completed correctly - Regression table (A11) and t-tests

pl_correct <- lm(formula = tasks_correct ~ treatment_information_provision, 
                 data = pl_rob,
                 weights = weight)

de_correct <- lm(formula = tasks_correct ~ treatment_information_provision, 
                 data = de_rob,
                 weights = weight)

stargazer(pl_correct, de_correct,
          type = "html",
          out = "correct_rob.doc",
          title = "Regression Table",
          style = "qje",
          dep.var.labels = c("Share of tasks completed correctly"),
          covariate.labels = c("Information",
                               "Information + Covid-19",
                               "Information + Russia"))

#### Robustness: Share of tasks completed correctly - Figure A10

pl_correct_retrieve <- plot_model(pl_correct, type = "pred")

pl_correct_df <- data.frame(level = pl_correct_retrieve[["plot_env"]][["x_lab"]],
                            estimate = pl_correct_retrieve[["data"]][["predicted"]],
                            lower = pl_correct_retrieve[["data"]][["conf.low"]],
                            higher = pl_correct_retrieve[["data"]][["conf.high"]],
                            country = "Poland")

de_correct_retrieve <- plot_model(de_correct, type = "pred")

de_correct_df <- data.frame(level = de_correct_retrieve[["plot_env"]][["x_lab"]],
                            estimate = de_correct_retrieve[["data"]][["predicted"]],
                            lower = de_correct_retrieve[["data"]][["conf.low"]],
                            higher = de_correct_retrieve[["data"]][["conf.high"]],
                            country = "Germany")

correct <- bind_rows(pl_correct_df, de_correct_df)

ggplot(correct,
       mapping = aes(x = estimate,
                     y = level,
                     xmin = lower,
                     xmax = higher)) +
  theme_bw() +
  geom_pointrange(aes(group = country,
                      color = country,
                      shape = country),
                  position = position_dodge(width = 0.5), size = 0.3) +
  theme(legend.position = "top") +
  labs(x = "Share of tasks completed correctly", 
       y = "", 
       color = "Country",
       shape = "Country") +
  #geom_vline(xintercept = 0.0, color = "gray") +
  scale_color_manual(values = c("#00008b", "maroon"))  +
  scale_x_continuous(breaks=seq(0,1,0.2)) +
  xlim(0,1) +
  coord_flip() +
  geom_vline(xintercept = 0.506046, color = "maroon", linetype="dotted") +
  geom_vline(xintercept = 0.454591, color = "#00008b", linetype="dotted") +
  scale_shape_manual(values=c(16, 15)) 

ggsave("correct_rob.jpg",
       height = 8,
       width = 8,
       scale = 0.5)

### Full distribution of responses across experimental conditions

#### Support for sanctions (Figure A4)

ggplot(pl[!is.na(pl$treatment_information_provision),],
       mapping = aes(x = treatment_information_provision,
                     y = support_info_provision,
                     fill = treatment_information_provision)) +
  theme_bw() +
  geom_rain(rain.side = 'l', alpha = .2,
            boxplot.args.pos = list(
              position = ggpp::position_dodgenudge(x = .15, width = 0.1), width = 0.05),
            violin.args.pos = list(
              side = "r",
              width = 0.7, position = position_nudge(x = 0.23)),
            point.args.pos = rlang::list2(position = position_jitter(width = 0.1, height = 0.2, seed = 50))) +
  theme(legend.position = "none") +
  labs(x = "", 
       y = "Support for sanctions") +
  scale_fill_jama()

ggsave("support_PL.jpg",
       height = 8,
       width = 14,
       scale = 0.5)

ggplot(de[!is.na(de$treatment_information_provision),],
       mapping = aes(x = treatment_information_provision,
                     y = support_info_provision,
                     fill = treatment_information_provision)) +
  theme_bw() +
  geom_rain(rain.side = 'l', alpha = .2,
            boxplot.args.pos = list(
              position = ggpp::position_dodgenudge(x = .15, width = 0.1), width = 0.05),
            violin.args.pos = list(
              side = "r",
              width = 0.7, position = position_nudge(x = 0.23)),
            point.args.pos = rlang::list2(position = position_jitter(width = 0.1, height = 0.2, seed = 50))) +
  theme(legend.position = "none") +
  labs(x = "", 
       y = "Support for sanctions") +
  scale_fill_jama()

ggsave("support_DE.jpg",
       height = 8,
       width = 14,
       scale = 0.5)

#### Cost perception (Figure A3)

ggplot(pl[!is.na(pl$treatment_information_provision),],
       mapping = aes(x = treatment_information_provision,
                     y = cost_info_provision,
                     fill = treatment_information_provision)) +
  theme_bw() +
  geom_rain(rain.side = 'l', alpha = .2,
            boxplot.args.pos = list(
              position = ggpp::position_dodgenudge(x = .15, width = 0.1), width = 0.05),
            violin.args.pos = list(
              side = "r",
              width = 0.7, position = position_nudge(x = 0.23)),
            point.args.pos = rlang::list2(position = position_jitter(width = 0.1, height = 0.2, seed = 50))) +
  theme(legend.position = "none") +
  labs(x = "", 
       y = "Perceived costs of sanctions") +
  scale_fill_jama()

ggsave("costs_PL.jpg",
       height = 8,
       width = 14,
       scale = 0.5)

ggplot(de[!is.na(de$treatment_information_provision),],
       mapping = aes(x = treatment_information_provision,
                     y = cost_info_provision,
                     fill = treatment_information_provision)) +
  theme_bw() +
  geom_rain(rain.side = 'l', alpha = .2,
            boxplot.args.pos = list(
              position = ggpp::position_dodgenudge(x = .15, width = 0.1), width = 0.05),
            violin.args.pos = list(
              side = "r",
              width = 0.7, position = position_nudge(x = 0.23)),
            point.args.pos = rlang::list2(position = position_jitter(width = 0.1, height = 0.2, seed = 50))) +
  theme(legend.position = "none") +
  labs(x = "", 
       y = "Perceived costs of sanctions") +
  scale_fill_jama()

ggsave("costs_DE.jpg",
       height = 8,
       width = 14,
       scale = 0.5)

#### Willingness to do tasks (Figure A5)

ggplot(pl[!is.na(pl$treatment_information_provision),],
       mapping = aes(x = treatment_information_provision,
                     y = effort_task,
                     fill = treatment_information_provision)) +
  theme_bw() +
  geom_rain(rain.side = 'l', alpha = .2,
            boxplot.args.pos = list(
              position = ggpp::position_dodgenudge(x = .15, width = 0.1), width = 0.05),
            violin.args.pos = list(
              side = "r",
              width = 0.7, position = position_nudge(x = 0.23)),
            point.args.pos = rlang::list2(position = position_jitter(width = 0.1, height = 0.2, seed = 50))) +
  theme(legend.position = "none") +
  labs(x = "", 
       y = "Number of tasks willing to complete") +
  scale_fill_jama()

ggsave("effort_PL.jpg",
       height = 8,
       width = 14,
       scale = 0.5)

ggplot(de[!is.na(de$treatment_information_provision),],
       mapping = aes(x = treatment_information_provision,
                     y = effort_task,
                     fill = treatment_information_provision)) +
  theme_bw() +
  geom_rain(rain.side = 'l', alpha = .2,
            boxplot.args.pos = list(
              position = ggpp::position_dodgenudge(x = .15, width = 0.1), width = 0.05),
            violin.args.pos = list(
              side = "r",
              width = 0.7, position = position_nudge(x = 0.23)),
            point.args.pos = rlang::list2(position = position_jitter(width = 0.1, height = 0.2, seed = 50))) +
  theme(legend.position = "none") +
  labs(x = "", 
       y = "Number of tasks willing to complete") +
  scale_fill_jama()

ggsave("effort_DE.jpg",
       height = 8,
       width = 14,
       scale = 0.5)

#### Share of tasks completed correctly (Figure A6)

ggplot(pl[!is.na(pl$treatment_information_provision),],
       mapping = aes(x = treatment_information_provision,
                     y = tasks_correct,
                     fill = treatment_information_provision)) +
  theme_bw() +
  geom_rain(rain.side = 'l', alpha = .2,
            boxplot.args.pos = list(
              position = ggpp::position_dodgenudge(x = .15, width = 0.1), width = 0.05),
            violin.args.pos = list(
              side = "r",
              width = 0.7, position = position_nudge(x = 0.23)),
            point.args.pos = rlang::list2(position = position_jitter(width = 0.1, height = 0.1, seed = 50))) +
  theme(legend.position = "none") +
  labs(x = "", 
       y = "Share of tasks completed correctly") +
  scale_fill_jama()

ggsave("complete_PL.jpg",
       height = 8,
       width = 14,
       scale = 0.5)

ggplot(de[!is.na(de$treatment_information_provision),],
       mapping = aes(x = treatment_information_provision,
                     y = tasks_correct,
                     fill = treatment_information_provision)) +
  theme_bw() +
  geom_rain(rain.side = 'l', alpha = .2,
            boxplot.args.pos = list(
              position = ggpp::position_dodgenudge(x = .15, width = 0.1), width = 0.05),
            violin.args.pos = list(
              side = "r",
              width = 0.7, position = position_nudge(x = 0.23)),
            point.args.pos = rlang::list2(position = position_jitter(width = 0.1, height = 0.1, seed = 50))) +
  theme(legend.position = "none") +
  labs(x = "", 
       y = "Share of tasks completed correctly") +
  scale_fill_jama()

ggsave("complete_DE.jpg",
       height = 8,
       width = 14,
       scale = 0.5)

### Subgroup analyses

#### Region: cost perception

##### Region: cost perception - Poland (Figure A12)

table(pl$region_cat)

pl <- pl %>% mutate(east_west = ifelse(region_cat=="dolnośląskie" |
                                         region_cat=="kujawsko-pomorskie" |
                                         region_cat=="lubuskie" |
                                         region_cat=="opolskie" |
                                         region_cat=="pomorskie" |
                                         region_cat=="śląskie" |
                                         region_cat=="wielkopolskie" |
                                         region_cat=="zachodniopomorskie", "West", "East"))

pl$east_west <- as.factor(pl$east_west) 

pl_cost <- lm(formula = cost_info_provision ~ treatment_information_provision * east_west, 
              data = pl,
              weights = weight)

plot_model(pl_cost, type = "int")

pl_cost_retrieve <- plot_model(pl_cost, type = "int")

pl_cost_df <- data.frame(level2 = pl_cost_retrieve[["plot_env"]][["x"]][["x"]],
                         estimate = pl_cost_retrieve[["plot_env"]][["x"]][["predicted"]],
                         lower = pl_cost_retrieve[["plot_env"]][["x"]][["conf.low"]],
                         higher = pl_cost_retrieve[["plot_env"]][["x"]][["conf.high"]],
                         group = pl_cost_retrieve[["plot_env"]][["x"]][["group"]])

pl_cost_df <- pl_cost_df %>% mutate(level = ifelse(level2==1, "Control",
                                                   ifelse(level2==2, "Information",
                                                          ifelse(level2==3, "Information \n + COVID-19",
                                                                 ifelse(level2==4, "Information \n + Russia", NA))))) 

ggplot(pl_cost_df,
       mapping = aes(x = estimate,
                     y = level,
                     xmin = lower,
                     xmax = higher)) +
  theme_bw() +
  geom_pointrange(aes(group = group,
                      color = group,
                      shape = group),
                  position = position_dodge(width = 0.5), size = 0.3) +
  theme(legend.position = "top") +
  labs(x = "Perceived costs of sanctions", 
       y = "", 
       color = "Group",
       shape = "Group") +
  geom_vline(xintercept = 0.0, color = "gray") +
  scale_color_manual(values = c("#00008b", "maroon"))  +
  scale_x_continuous(breaks=seq(1,7,1)) +
  xlim(1,7) +
  coord_flip() +
  geom_vline(xintercept = 4.045983, color = "maroon", linetype="dotted") +
  geom_vline(xintercept = 4.507790, color = "#00008b", linetype="dotted") +
  scale_shape_manual(values=c(16, 15)) 

ggsave("PL_costs_region.jpg",
       height = 8,
       width = 8,
       scale = 0.5)

##### Region: cost perception - Germany (Figure A11)

table(de$region_cat)

de <- de %>% mutate(east_west = ifelse(region_cat=="Thüringen" |
                                         region_cat=="Sachsen-Anhalt" |
                                         region_cat=="Sachsen" |
                                         region_cat=="Berlin" |
                                         region_cat=="Brandenburg" |
                                         region_cat=="Mecklenburg-Vorpommern", "East", "West"))

de$east_west <- as.factor(de$east_west) 

de_cost <- lm(formula = cost_info_provision ~ treatment_information_provision * east_west, 
              data = de,
              weights = weight)

plot_model(de_cost, type = "int")

de_cost_retrieve <- plot_model(de_cost, type = "int")

de_cost_df <- data.frame(level2 = de_cost_retrieve[["plot_env"]][["x"]][["x"]],
                         estimate = de_cost_retrieve[["plot_env"]][["x"]][["predicted"]],
                         lower = de_cost_retrieve[["plot_env"]][["x"]][["conf.low"]],
                         higher = de_cost_retrieve[["plot_env"]][["x"]][["conf.high"]],
                         group = de_cost_retrieve[["plot_env"]][["x"]][["group"]])

de_cost_df <- de_cost_df %>% mutate(level = ifelse(level2==1, "Control",
                                                   ifelse(level2==2, "Information",
                                                          ifelse(level2==3, "Information \n + COVID-19",
                                                                 ifelse(level2==4, "Information \n + Russia", NA))))) 

ggplot(de_cost_df,
       mapping = aes(x = estimate,
                     y = level,
                     xmin = lower,
                     xmax = higher)) +
  theme_bw() +
  geom_pointrange(aes(group = group,
                      color = group,
                      shape = group),
                  position = position_dodge(width = 0.5), size = 0.3) +
  theme(legend.position = "top") +
  labs(x = "Perceived costs of sanctions", 
       y = "", 
       color = "Group",
       shape = "Group") +
  geom_vline(xintercept = 0.0, color = "gray") +
  scale_color_manual(values = c("#00008b", "maroon"))  +
  scale_x_continuous(breaks=seq(1,7,1)) +
  xlim(1,7) +
  coord_flip() +
  geom_vline(xintercept = 4.551750, color = "maroon", linetype="dotted") +
  geom_vline(xintercept = 4.923650, color = "#00008b", linetype="dotted") +
  scale_shape_manual(values=c(16, 15)) 

ggsave("DE_costs_region.jpg",
       height = 8,
       width = 8,
       scale = 0.5)

#### Region: support for sanctions

##### Region: support for sanctions - Poland (Figure A12)

pl_support <- lm(formula = support_info_provision ~ treatment_information_provision * east_west, 
                 data = pl,
                 weights = weight)

plot_model(pl_support, type = "int")

pl_support_retrieve <- plot_model(pl_support, type = "int")

pl_support_df <- data.frame(level2 = pl_support_retrieve[["plot_env"]][["x"]][["x"]],
                            estimate = pl_support_retrieve[["plot_env"]][["x"]][["predicted"]],
                            lower = pl_support_retrieve[["plot_env"]][["x"]][["conf.low"]],
                            higher = pl_support_retrieve[["plot_env"]][["x"]][["conf.high"]],
                            group = pl_support_retrieve[["plot_env"]][["x"]][["group"]])

pl_support_df <- pl_support_df %>% mutate(level = ifelse(level2==1, "Control",
                                                         ifelse(level2==2, "Information",
                                                                ifelse(level2==3, "Information \n + COVID-19",
                                                                       ifelse(level2==4, "Information \n + Russia", NA))))) 

ggplot(pl_support_df,
       mapping = aes(x = estimate,
                     y = level,
                     xmin = lower,
                     xmax = higher)) +
  theme_bw() +
  geom_pointrange(aes(group = group,
                      color = group,
                      shape = group),
                  position = position_dodge(width = 0.5), size = 0.3) +
  theme(legend.position = "top") +
  labs(x = "Support for sanctions", 
       y = "", 
       color = "Group",
       shape = "Group") +
  geom_vline(xintercept = 0.0, color = "gray") +
  scale_color_manual(values = c("#00008b", "maroon"))  +
  scale_x_continuous(breaks=seq(1,7,1)) +
  xlim(1,7) +
  coord_flip() +
  geom_vline(xintercept = 5.024491, color = "maroon", linetype="dotted") +
  geom_vline(xintercept = 4.912349, color = "#00008b", linetype="dotted") +
  scale_shape_manual(values=c(16, 15)) 

ggsave("PL_support_region.jpg",
       height = 8,
       width = 8,
       scale = 0.5)

##### Region: support for sanctions - Germany (Figure A11)

de_support <- lm(formula = support_info_provision ~ treatment_information_provision * east_west, 
                 data = de,
                 weights = weight)

plot_model(de_support, type = "int")

de_support_retrieve <- plot_model(de_support, type = "int")

de_support_df <- data.frame(level2 = de_support_retrieve[["plot_env"]][["x"]][["x"]],
                            estimate = de_support_retrieve[["plot_env"]][["x"]][["predicted"]],
                            lower = de_support_retrieve[["plot_env"]][["x"]][["conf.low"]],
                            higher = de_support_retrieve[["plot_env"]][["x"]][["conf.high"]],
                            group = de_support_retrieve[["plot_env"]][["x"]][["group"]])

de_support_df <- de_support_df %>% mutate(level = ifelse(level2==1, "Control",
                                                         ifelse(level2==2, "Information",
                                                                ifelse(level2==3, "Information \n + COVID-19",
                                                                       ifelse(level2==4, "Information \n + Russia", NA))))) 

ggplot(de_support_df,
       mapping = aes(x = estimate,
                     y = level,
                     xmin = lower,
                     xmax = higher)) +
  theme_bw() +
  geom_pointrange(aes(group = group,
                      color = group,
                      shape = group),
                  position = position_dodge(width = 0.5), size = 0.3) +
  theme(legend.position = "top") +
  labs(x = "Support for sanctions", 
       y = "", 
       color = "Group",
       shape = "Group") +
  geom_vline(xintercept = 0.0, color = "gray") +
  scale_color_manual(values = c("#00008b", "maroon"))  +
  scale_x_continuous(breaks=seq(1,7,1)) +
  xlim(1,7) +
  coord_flip() +
  geom_vline(xintercept = 4.062791, color = "maroon", linetype="dotted") +
  geom_vline(xintercept = 4.254383, color = "#00008b", linetype="dotted") +
  scale_shape_manual(values=c(16, 15)) 

ggsave("DE_support_region.jpg",
       height = 8,
       width = 8,
       scale = 0.5)

#### Populist preferences: cost perception

##### Populist preferences: cost perception - Poland (Figure A14)

table(pl$party)

pl <- pl %>% mutate(populism = ifelse(party==1 |
                                        party==4, "Populist preferences", "Other"))

pl$populism <- as.factor(pl$populism) 

pl_cost <- lm(formula = cost_info_provision ~ treatment_information_provision * populism, 
              data = pl,
              weights = weight)

plot_model(pl_cost, type = "int")

pl_cost_retrieve <- plot_model(pl_cost, type = "int")

pl_cost_df <- data.frame(level2 = pl_cost_retrieve[["plot_env"]][["x"]][["x"]],
                         estimate = pl_cost_retrieve[["plot_env"]][["x"]][["predicted"]],
                         lower = pl_cost_retrieve[["plot_env"]][["x"]][["conf.low"]],
                         higher = pl_cost_retrieve[["plot_env"]][["x"]][["conf.high"]],
                         group = pl_cost_retrieve[["plot_env"]][["x"]][["group"]])

pl_cost_df <- pl_cost_df %>% mutate(level = ifelse(level2==1, "Control",
                                                   ifelse(level2==2, "Information",
                                                          ifelse(level2==3, "Information \n + COVID-19",
                                                                 ifelse(level2==4, "Information \n + Russia", NA))))) 

ggplot(pl_cost_df,
       mapping = aes(x = estimate,
                     y = level,
                     xmin = lower,
                     xmax = higher)) +
  theme_bw() +
  geom_pointrange(aes(group = group,
                      color = group,
                      shape = group),
                  position = position_dodge(width = 0.5), size = 0.3) +
  theme(legend.position = "top") +
  labs(x = "Perceived costs of sanctions", 
       y = "", 
       color = "Group",
       shape = "Group") +
  geom_vline(xintercept = 0.0, color = "gray") +
  scale_color_manual(values = c("#00008b", "maroon"))  +
  scale_x_continuous(breaks=seq(1,7,1)) +
  xlim(1,7) +
  coord_flip() +
  geom_vline(xintercept = 4.263690, color = "maroon", linetype="dotted") +
  geom_vline(xintercept = 4.256764, color = "#00008b", linetype="dotted") +
  scale_shape_manual(values=c(16, 15)) 

ggsave("PL_costs_populism.jpg",
       height = 8,
       width = 8,
       scale = 0.5)

##### Populist preferences: cost perception - Germany (Figure A13)

table(de$party)

de <- de %>% mutate(populism = ifelse(party==3 |
                                        region_cat==5, "Populist preferences", "Other"))

de$populism <- as.factor(de$populism) 

de_cost <- lm(formula = cost_info_provision ~ treatment_information_provision * populism, 
              data = de,
              weights = weight)

plot_model(de_cost, type = "int")

de_cost_retrieve <- plot_model(de_cost, type = "int")

de_cost_df <- data.frame(level2 = de_cost_retrieve[["plot_env"]][["x"]][["x"]],
                         estimate = de_cost_retrieve[["plot_env"]][["x"]][["predicted"]],
                         lower = de_cost_retrieve[["plot_env"]][["x"]][["conf.low"]],
                         higher = de_cost_retrieve[["plot_env"]][["x"]][["conf.high"]],
                         group = de_cost_retrieve[["plot_env"]][["x"]][["group"]])

de_cost_df <- de_cost_df %>% mutate(level = ifelse(level2==1, "Control",
                                                   ifelse(level2==2, "Information",
                                                          ifelse(level2==3, "Information \n + COVID-19",
                                                                 ifelse(level2==4, "Information \n + Russia", NA))))) 

ggplot(de_cost_df,
       mapping = aes(x = estimate,
                     y = level,
                     xmin = lower,
                     xmax = higher)) +
  theme_bw() +
  geom_pointrange(aes(group = group,
                      color = group,
                      shape = group),
                  position = position_dodge(width = 0.5), size = 0.3) +
  theme(legend.position = "top") +
  labs(x = "Perceived costs of sanctions", 
       y = "", 
       color = "Group",
       shape = "Group") +
  geom_vline(xintercept = 0.0, color = "gray") +
  scale_color_manual(values = c("#00008b", "maroon"))  +
  scale_x_continuous(breaks=seq(1,7,1)) +
  xlim(1,7) +
  coord_flip() +
  geom_vline(xintercept = 5.751669, color = "maroon", linetype="dotted") +
  geom_vline(xintercept = 4.531947, color = "#00008b", linetype="dotted") +
  scale_shape_manual(values=c(16, 15)) 

ggsave("DE_costs_populism.jpg",
       height = 8,
       width = 8,
       scale = 0.5)


#### Populist preferences: support for sanctions

##### Populist preferences: support for sanctions - Poland (Figure A14)

pl_support <- lm(formula = support_info_provision ~ treatment_information_provision * populism, 
                 data = pl,
                 weights = weight)

plot_model(pl_support, type = "int")

pl_support_retrieve <- plot_model(pl_support, type = "int")

pl_support_df <- data.frame(level2 = pl_support_retrieve[["plot_env"]][["x"]][["x"]],
                            estimate = pl_support_retrieve[["plot_env"]][["x"]][["predicted"]],
                            lower = pl_support_retrieve[["plot_env"]][["x"]][["conf.low"]],
                            higher = pl_support_retrieve[["plot_env"]][["x"]][["conf.high"]],
                            group = pl_support_retrieve[["plot_env"]][["x"]][["group"]])

pl_support_df <- pl_support_df %>% mutate(level = ifelse(level2==1, "Control",
                                                         ifelse(level2==2, "Information",
                                                                ifelse(level2==3, "Information \n + COVID-19",
                                                                       ifelse(level2==4, "Information \n + Russia", NA))))) 

ggplot(pl_support_df,
       mapping = aes(x = estimate,
                     y = level,
                     xmin = lower,
                     xmax = higher)) +
  theme_bw() +
  geom_pointrange(aes(group = group,
                      color = group,
                      shape = group),
                  position = position_dodge(width = 0.5), size = 0.3) +
  theme(legend.position = "top") +
  labs(x = "Support for sanctions", 
       y = "", 
       color = "Group",
       shape = "Group") +
  geom_vline(xintercept = 0.0, color = "gray") +
  scale_color_manual(values = c("#00008b", "maroon"))  +
  scale_x_continuous(breaks=seq(1,7,1)) +
  xlim(1,7) +
  coord_flip() +
  geom_vline(xintercept = 4.890162, color = "maroon", linetype="dotted") +
  geom_vline(xintercept = 5.008290, color = "#00008b", linetype="dotted") +
  scale_shape_manual(values=c(16, 15)) 

ggsave("PL_support_populism.jpg",
       height = 8,
       width = 8,
       scale = 0.5)

##### Populist preferences: support for sanctions - Germany (Figure A13)

de_support <- lm(formula = support_info_provision ~ treatment_information_provision * populism, 
                 data = de,
                 weights = weight)

plot_model(de_support, type = "int")

de_support_retrieve <- plot_model(de_support, type = "int")

de_support_df <- data.frame(level2 = de_support_retrieve[["plot_env"]][["x"]][["x"]],
                            estimate = de_support_retrieve[["plot_env"]][["x"]][["predicted"]],
                            lower = de_support_retrieve[["plot_env"]][["x"]][["conf.low"]],
                            higher = de_support_retrieve[["plot_env"]][["x"]][["conf.high"]],
                            group = de_support_retrieve[["plot_env"]][["x"]][["group"]])

de_support_df <- de_support_df %>% mutate(level = ifelse(level2==1, "Control",
                                                         ifelse(level2==2, "Information",
                                                                ifelse(level2==3, "Information \n + COVID-19",
                                                                       ifelse(level2==4, "Information \n + Russia", NA))))) 

ggplot(de_support_df,
       mapping = aes(x = estimate,
                     y = level,
                     xmin = lower,
                     xmax = higher)) +
  theme_bw() +
  geom_pointrange(aes(group = group,
                      color = group,
                      shape = group),
                  position = position_dodge(width = 0.5), size = 0.3) +
  theme(legend.position = "top") +
  labs(x = "Support for sanctions", 
       y = "", 
       color = "Group",
       shape = "Group") +
  geom_vline(xintercept = 0.0, color = "gray") +
  scale_color_manual(values = c("#00008b", "maroon"))  +
  scale_x_continuous(breaks=seq(1,7,1)) +
  xlim(1,7) +
  coord_flip() +
  geom_vline(xintercept = 2.584367, color = "maroon", linetype="dotted") +
  geom_vline(xintercept = 4.226710, color = "#00008b", linetype="dotted") +
  scale_shape_manual(values=c(16, 15)) 

ggsave("DE_support_populism.jpg",
       height = 8,
       width = 8,
       scale = 0.5)

#### Ideology: cost perception

##### Ideology: cost perception - Poland (Figure A16)

table(pl$ideology_1)

pl$ideology_1 <- as.numeric(pl$ideology_1)

pl <- pl %>% mutate(ideology = ifelse(ideology_1>=6 & ideology_1<=10, "Right",
                                      ifelse(ideology_1>=0 & ideology_1<=5, "Left and center", NA)))

pl$ideology <- as.factor(pl$ideology) 

pl_cost <- lm(formula = cost_info_provision ~ treatment_information_provision * ideology, 
              data = pl,
              weights = weight)

plot_model(pl_cost, type = "int")

pl_cost_retrieve <- plot_model(pl_cost, type = "int")

pl_cost_df <- data.frame(level2 = pl_cost_retrieve[["plot_env"]][["x"]][["x"]],
                         estimate = pl_cost_retrieve[["plot_env"]][["x"]][["predicted"]],
                         lower = pl_cost_retrieve[["plot_env"]][["x"]][["conf.low"]],
                         higher = pl_cost_retrieve[["plot_env"]][["x"]][["conf.high"]],
                         group = pl_cost_retrieve[["plot_env"]][["x"]][["group"]])

pl_cost_df <- pl_cost_df %>% mutate(level = ifelse(level2==1, "Control",
                                                   ifelse(level2==2, "Information",
                                                          ifelse(level2==3, "Information \n + COVID-19",
                                                                 ifelse(level2==4, "Information \n + Russia", NA))))) 

ggplot(pl_cost_df,
       mapping = aes(x = estimate,
                     y = level,
                     xmin = lower,
                     xmax = higher)) +
  theme_bw() +
  geom_pointrange(aes(group = group,
                      color = group,
                      shape = group),
                  position = position_dodge(width = 0.5), size = 0.3) +
  theme(legend.position = "top") +
  labs(x = "Perceived costs of sanctions", 
       y = "", 
       color = "Group",
       shape = "Group") +
  geom_vline(xintercept = 0.0, color = "gray") +
  scale_color_manual(values = c("#00008b", "maroon"))  +
  scale_x_continuous(breaks=seq(1,7,1)) +
  xlim(1,7) +
  coord_flip() +
  geom_vline(xintercept = 4.180018, color = "maroon", linetype="dotted") +
  geom_vline(xintercept = 4.301956, color = "#00008b", linetype="dotted") +
  scale_shape_manual(values=c(16, 15)) 

ggsave("PL_costs_ideology.jpg",
       height = 8,
       width = 8,
       scale = 0.5)

##### Ideology: cost perception - Germany (Figure A15)

table(de$ideology_1)

de$ideology_1 <- as.numeric(de$ideology_1)

de <- de %>% mutate(ideology = ifelse(ideology_1>=6 & ideology_1<=10, "Right",
                                      ifelse(ideology_1>=0 & ideology_1<=5, "Left and center", NA)))

de$ideology <- as.factor(de$ideology) 

de_cost <- lm(formula = cost_info_provision ~ treatment_information_provision * ideology, 
              data = de,
              weights = weight)

plot_model(de_cost, type = "int")

de_cost_retrieve <- plot_model(de_cost, type = "int")

de_cost_df <- data.frame(level2 = de_cost_retrieve[["plot_env"]][["x"]][["x"]],
                         estimate = de_cost_retrieve[["plot_env"]][["x"]][["predicted"]],
                         lower = de_cost_retrieve[["plot_env"]][["x"]][["conf.low"]],
                         higher = de_cost_retrieve[["plot_env"]][["x"]][["conf.high"]],
                         group = de_cost_retrieve[["plot_env"]][["x"]][["group"]])

de_cost_df <- de_cost_df %>% mutate(level = ifelse(level2==1, "Control",
                                                   ifelse(level2==2, "Information",
                                                          ifelse(level2==3, "Information \n + COVID-19",
                                                                 ifelse(level2==4, "Information \n + Russia", NA))))) 

ggplot(de_cost_df,
       mapping = aes(x = estimate,
                     y = level,
                     xmin = lower,
                     xmax = higher)) +
  theme_bw() +
  geom_pointrange(aes(group = group,
                      color = group,
                      shape = group),
                  position = position_dodge(width = 0.5), size = 0.3) +
  theme(legend.position = "top") +
  labs(x = "Perceived costs of sanctions", 
       y = "", 
       color = "Group",
       shape = "Group") +
  geom_vline(xintercept = 0.0, color = "gray") +
  scale_color_manual(values = c("#00008b", "maroon"))  +
  scale_x_continuous(breaks=seq(1,7,1)) +
  xlim(1,7) +
  coord_flip() +
  geom_vline(xintercept = 4.754288, color = "maroon", linetype="dotted") +
  geom_vline(xintercept = 4.569390, color = "#00008b", linetype="dotted") +
  scale_shape_manual(values=c(16, 15)) 

ggsave("DE_costs_ideology.jpg",
       height = 8,
       width = 8,
       scale = 0.5)

#### Ideology: support for sanctions

##### Ideology: support for sanctions - Poland (Figure A16)

pl_support <- lm(formula = support_info_provision ~ treatment_information_provision * ideology, 
                 data = pl,
                 weights = weight)

plot_model(pl_support, type = "int")

pl_support_retrieve <- plot_model(pl_support, type = "int")

pl_support_df <- data.frame(level2 = pl_support_retrieve[["plot_env"]][["x"]][["x"]],
                            estimate = pl_support_retrieve[["plot_env"]][["x"]][["predicted"]],
                            lower = pl_support_retrieve[["plot_env"]][["x"]][["conf.low"]],
                            higher = pl_support_retrieve[["plot_env"]][["x"]][["conf.high"]],
                            group = pl_support_retrieve[["plot_env"]][["x"]][["group"]])

pl_support_df <- pl_support_df %>% mutate(level = ifelse(level2==1, "Control",
                                                         ifelse(level2==2, "Information",
                                                                ifelse(level2==3, "Information \n + COVID-19",
                                                                       ifelse(level2==4, "Information \n + Russia", NA))))) 

ggplot(pl_support_df,
       mapping = aes(x = estimate,
                     y = level,
                     xmin = lower,
                     xmax = higher)) +
  theme_bw() +
  geom_pointrange(aes(group = group,
                      color = group,
                      shape = group),
                  position = position_dodge(width = 0.5), size = 0.3) +
  theme(legend.position = "top") +
  labs(x = "Support for sanctions", 
       y = "", 
       color = "Group",
       shape = "Group") +
  geom_vline(xintercept = 0.0, color = "gray") +
  scale_color_manual(values = c("#00008b", "maroon"))  +
  scale_x_continuous(breaks=seq(1,7,1)) +
  xlim(1,7) +
  coord_flip() +
  geom_vline(xintercept = 4.986077, color = "maroon", linetype="dotted") +
  geom_vline(xintercept = 4.969709, color = "#00008b", linetype="dotted") +
  scale_shape_manual(values=c(16, 15)) 

ggsave("PL_support_ideology.jpg",
       height = 8,
       width = 8,
       scale = 0.5)

##### Ideology: support for sanctions - Germany (Figure A15)

de_support <- lm(formula = support_info_provision ~ treatment_information_provision * ideology, 
                 data = de,
                 weights = weight)

plot_model(de_support, type = "int")

de_support_retrieve <- plot_model(de_support, type = "int")

de_support_df <- data.frame(level2 = de_support_retrieve[["plot_env"]][["x"]][["x"]],
                            estimate = de_support_retrieve[["plot_env"]][["x"]][["predicted"]],
                            lower = de_support_retrieve[["plot_env"]][["x"]][["conf.low"]],
                            higher = de_support_retrieve[["plot_env"]][["x"]][["conf.high"]],
                            group = de_support_retrieve[["plot_env"]][["x"]][["group"]])

de_support_df <- de_support_df %>% mutate(level = ifelse(level2==1, "Control",
                                                         ifelse(level2==2, "Information",
                                                                ifelse(level2==3, "Information \n + COVID-19",
                                                                       ifelse(level2==4, "Information \n + Russia", NA))))) 

ggplot(de_support_df,
       mapping = aes(x = estimate,
                     y = level,
                     xmin = lower,
                     xmax = higher)) +
  theme_bw() +
  geom_pointrange(aes(group = group,
                      color = group,
                      shape = group),
                  position = position_dodge(width = 0.5), size = 0.3) +
  theme(legend.position = "top") +
  labs(x = "Support for sanctions", 
       y = "", 
       color = "Group",
       shape = "Group") +
  geom_vline(xintercept = 0.0, color = "gray") +
  scale_color_manual(values = c("#00008b", "maroon"))  +
  scale_x_continuous(breaks=seq(1,7,1)) +
  xlim(1,7) +
  coord_flip() +
  geom_vline(xintercept = 3.771407, color = "maroon", linetype="dotted") +
  geom_vline(xintercept = 4.244186, color = "#00008b", linetype="dotted") +
  scale_shape_manual(values=c(16, 15)) 

ggsave("DE_support_ideology.jpg",
       height = 8,
       width = 8,
       scale = 0.5)

#### Income: cost perception

##### Income: cost perception - Poland (Figure A18)

table(pl$income)

pl$income <- as.numeric(pl$income)

median(pl$income, na.rm = TRUE)

pl <- pl %>% mutate(income_cat = ifelse(income>=4 & income<=6, "Higher income",
                                        ifelse(income>=1 & income<=3, "Lower income", NA)))

pl$income_cat <- as.factor(pl$income_cat) 

pl_cost <- lm(formula = cost_info_provision ~ treatment_information_provision * income_cat, 
              data = pl,
              weights = weight)

plot_model(pl_cost, type = "int")

pl_cost_retrieve <- plot_model(pl_cost, type = "int")

pl_cost_df <- data.frame(level2 = pl_cost_retrieve[["plot_env"]][["x"]][["x"]],
                         estimate = pl_cost_retrieve[["plot_env"]][["x"]][["predicted"]],
                         lower = pl_cost_retrieve[["plot_env"]][["x"]][["conf.low"]],
                         higher = pl_cost_retrieve[["plot_env"]][["x"]][["conf.high"]],
                         group = pl_cost_retrieve[["plot_env"]][["x"]][["group"]])

pl_cost_df <- pl_cost_df %>% mutate(level = ifelse(level2==1, "Control",
                                                   ifelse(level2==2, "Information",
                                                          ifelse(level2==3, "Information \n + COVID-19",
                                                                 ifelse(level2==4, "Information \n + Russia", NA))))) 

ggplot(pl_cost_df,
       mapping = aes(x = estimate,
                     y = level,
                     xmin = lower,
                     xmax = higher)) +
  theme_bw() +
  geom_pointrange(aes(group = group,
                      color = group,
                      shape = group),
                  position = position_dodge(width = 0.5), size = 0.3) +
  theme(legend.position = "top") +
  labs(x = "Perceived costs of sanctions", 
       y = "", 
       color = "Group",
       shape = "Group") +
  geom_vline(xintercept = 0.0, color = "gray") +
  scale_color_manual(values = c("#00008b", "maroon"))  +
  scale_x_continuous(breaks=seq(1,7,1)) +
  xlim(1,7) +
  coord_flip() +
  geom_vline(xintercept = 4.312587, color = "maroon", linetype="dotted") +
  geom_vline(xintercept = 4.219632, color = "#00008b", linetype="dotted") +
  scale_shape_manual(values=c(16, 15)) 

ggsave("PL_costs_income.jpg",
       height = 8,
       width = 8,
       scale = 0.5)

##### Income: cost perception - Germany (Figure A17)

table(de$income)

de$income <- as.numeric(de$income)

median(de$income, na.rm = TRUE)

de <- de %>% mutate(income_cat = ifelse(income>=3 & income<=6, "Higher income",
                                        ifelse(income>=1 & income<=2, "Lower income", NA)))

de$income_cat <- as.factor(de$income_cat) 

de_cost <- lm(formula = cost_info_provision ~ treatment_information_provision * income_cat, 
              data = de,
              weights = weight)

plot_model(de_cost, type = "int")

de_cost_retrieve <- plot_model(de_cost, type = "int")

de_cost_df <- data.frame(level2 = de_cost_retrieve[["plot_env"]][["x"]][["x"]],
                         estimate = de_cost_retrieve[["plot_env"]][["x"]][["predicted"]],
                         lower = de_cost_retrieve[["plot_env"]][["x"]][["conf.low"]],
                         higher = de_cost_retrieve[["plot_env"]][["x"]][["conf.high"]],
                         group = de_cost_retrieve[["plot_env"]][["x"]][["group"]])

de_cost_df <- de_cost_df %>% mutate(level = ifelse(level2==1, "Control",
                                                   ifelse(level2==2, "Information",
                                                          ifelse(level2==3, "Information \n + COVID-19",
                                                                 ifelse(level2==4, "Information \n + Russia", NA))))) 

ggplot(de_cost_df,
       mapping = aes(x = estimate,
                     y = level,
                     xmin = lower,
                     xmax = higher)) +
  theme_bw() +
  geom_pointrange(aes(group = group,
                      color = group,
                      shape = group),
                  position = position_dodge(width = 0.5), size = 0.3) +
  theme(legend.position = "top") +
  labs(x = "Perceived costs of sanctions", 
       y = "", 
       color = "Group",
       shape = "Group") +
  geom_vline(xintercept = 0.0, color = "gray") +
  scale_color_manual(values = c("#00008b", "maroon"))  +
  scale_x_continuous(breaks=seq(1,7,1)) +
  xlim(1,7) +
  coord_flip() +
  geom_vline(xintercept = 4.482306, color = "maroon", linetype="dotted") +
  geom_vline(xintercept = 4.730052, color = "#00008b", linetype="dotted") +
  scale_shape_manual(values=c(16, 15)) 

ggsave("DE_costs_income.jpg",
       height = 8,
       width = 8,
       scale = 0.5)

#### Income: Support for sanctions

##### Income: Support for sanctions - Poland (Figure A18)

pl_support <- lm(formula = support_info_provision ~ treatment_information_provision * income_cat, 
                 data = pl,
                 weights = weight)

plot_model(pl_support, type = "int")

pl_support_retrieve <- plot_model(pl_support, type = "int")

pl_support_df <- data.frame(level2 = pl_support_retrieve[["plot_env"]][["x"]][["x"]],
                            estimate = pl_support_retrieve[["plot_env"]][["x"]][["predicted"]],
                            lower = pl_support_retrieve[["plot_env"]][["x"]][["conf.low"]],
                            higher = pl_support_retrieve[["plot_env"]][["x"]][["conf.high"]],
                            group = pl_support_retrieve[["plot_env"]][["x"]][["group"]])

pl_support_df <- pl_support_df %>% mutate(level = ifelse(level2==1, "Control",
                                                         ifelse(level2==2, "Information",
                                                                ifelse(level2==3, "Information \n + COVID-19",
                                                                       ifelse(level2==4, "Information \n + Russia", NA))))) 

ggplot(pl_support_df,
       mapping = aes(x = estimate,
                     y = level,
                     xmin = lower,
                     xmax = higher)) +
  theme_bw() +
  geom_pointrange(aes(group = group,
                      color = group,
                      shape = group),
                  position = position_dodge(width = 0.5), size = 0.3) +
  theme(legend.position = "top") +
  labs(x = "Support for sanctions", 
       y = "", 
       color = "Group",
       shape = "Group") +
  geom_vline(xintercept = 0.0, color = "gray") +
  scale_color_manual(values = c("#00008b", "maroon"))  +
  scale_x_continuous(breaks=seq(1,7,1)) +
  xlim(1,7) +
  coord_flip() +
  geom_vline(xintercept = 4.963660, color = "maroon", linetype="dotted") +
  geom_vline(xintercept = 4.993917, color = "#00008b", linetype="dotted") +
  scale_shape_manual(values=c(16, 15)) 

ggsave("PL_support_income.jpg",
       height = 8,
       width = 8,
       scale = 0.5)

##### Income: Support for sanctions - Germany (Figure A17)

de_support <- lm(formula = support_info_provision ~ treatment_information_provision * income_cat, 
                 data = de,
                 weights = weight)

plot_model(de_support, type = "int")

de_support_retrieve <- plot_model(de_support, type = "int")

de_support_df <- data.frame(level2 = de_support_retrieve[["plot_env"]][["x"]][["x"]],
                            estimate = de_support_retrieve[["plot_env"]][["x"]][["predicted"]],
                            lower = de_support_retrieve[["plot_env"]][["x"]][["conf.low"]],
                            higher = de_support_retrieve[["plot_env"]][["x"]][["conf.high"]],
                            group = de_support_retrieve[["plot_env"]][["x"]][["group"]])

de_support_df <- de_support_df %>% mutate(level = ifelse(level2==1, "Control",
                                                         ifelse(level2==2, "Information",
                                                                ifelse(level2==3, "Information \n + COVID-19",
                                                                       ifelse(level2==4, "Information \n + Russia", NA))))) 

ggplot(de_support_df,
       mapping = aes(x = estimate,
                     y = level,
                     xmin = lower,
                     xmax = higher)) +
  theme_bw() +
  geom_pointrange(aes(group = group,
                      color = group,
                      shape = group),
                  position = position_dodge(width = 0.5), size = 0.3) +
  theme(legend.position = "top") +
  labs(x = "Support for sanctions", 
       y = "", 
       color = "Group",
       shape = "Group") +
  geom_vline(xintercept = 0.0, color = "gray") +
  scale_color_manual(values = c("#00008b", "maroon"))  +
  scale_x_continuous(breaks=seq(1,7,1)) +
  xlim(1,7) +
  coord_flip() +
  geom_vline(xintercept = 4.096584, color = "maroon", linetype="dotted") +
  geom_vline(xintercept = 4.094477, color = "#00008b", linetype="dotted") +
  scale_shape_manual(values=c(16, 15)) 

ggsave("DE_support_income.jpg",
       height = 8,
       width = 8,
       scale = 0.5)

#### Additional information anchor: Cost perception

##### Additional information anchor: Cost perception - Poland (Figure A20)

table(pl$treatment_anchor)

pl$treatment_anchor <- as.factor(pl$treatment_anchor) 

pl_cost <- lm(formula = cost_info_provision ~ treatment_information_provision * treatment_anchor, 
              data = pl,
              weights = weight)

plot_model(pl_cost, type = "int")

pl_cost_retrieve <- plot_model(pl_cost, type = "int")

pl_cost_df <- data.frame(level2 = pl_cost_retrieve[["plot_env"]][["x"]][["x"]],
                         estimate = pl_cost_retrieve[["plot_env"]][["x"]][["predicted"]],
                         lower = pl_cost_retrieve[["plot_env"]][["x"]][["conf.low"]],
                         higher = pl_cost_retrieve[["plot_env"]][["x"]][["conf.high"]],
                         group = pl_cost_retrieve[["plot_env"]][["x"]][["group"]])

pl_cost_df <- pl_cost_df %>% mutate(level = ifelse(level2==1, "Control",
                                                   ifelse(level2==2, "Information",
                                                          ifelse(level2==3, "Information \n + COVID-19",
                                                                 ifelse(level2==4, "Information \n + Russia", NA))))) 

ggplot(pl_cost_df,
       mapping = aes(x = estimate,
                     y = level,
                     xmin = lower,
                     xmax = higher)) +
  theme_bw() +
  geom_pointrange(aes(group = group,
                      color = group,
                      shape = group),
                  position = position_dodge(width = 0.5), size = 0.3) +
  theme(legend.position = "top") +
  labs(x = "Perceived costs of sanctions", 
       y = "", 
       color = "Group",
       shape = "Group") +
  geom_vline(xintercept = 0.0, color = "gray") +
  scale_color_manual(values = c("#00008b", "maroon"))  +
  scale_x_continuous(breaks=seq(1,7,1)) +
  xlim(1,7) +
  coord_flip() +
  geom_vline(xintercept = 4.090677, color = "maroon", linetype="dotted") +
  geom_vline(xintercept = 4.423645, color = "#00008b", linetype="dotted") +
  scale_shape_manual(values=c(16, 15)) 

ggsave("PL_costs_anchor.jpg",
       height = 8,
       width = 8,
       scale = 0.5)

##### Additional information anchor: Cost perception - Germany (Figure A19)

table(de$treatment_anchor)

de$treatment_anchor <- as.factor(de$treatment_anchor) 

de_cost <- lm(formula = cost_info_provision ~ treatment_information_provision * treatment_anchor, 
              data = de,
              weights = weight)

plot_model(de_cost, type = "int")

de_cost_retrieve <- plot_model(de_cost, type = "int")

de_cost_df <- data.frame(level2 = de_cost_retrieve[["plot_env"]][["x"]][["x"]],
                         estimate = de_cost_retrieve[["plot_env"]][["x"]][["predicted"]],
                         lower = de_cost_retrieve[["plot_env"]][["x"]][["conf.low"]],
                         higher = de_cost_retrieve[["plot_env"]][["x"]][["conf.high"]],
                         group = de_cost_retrieve[["plot_env"]][["x"]][["group"]])

de_cost_df <- de_cost_df %>% mutate(level = ifelse(level2==1, "Control",
                                                   ifelse(level2==2, "Information",
                                                          ifelse(level2==3, "Information \n + COVID-19",
                                                                 ifelse(level2==4, "Information \n + Russia", NA))))) 

ggplot(de_cost_df,
       mapping = aes(x = estimate,
                     y = level,
                     xmin = lower,
                     xmax = higher)) +
  theme_bw() +
  geom_pointrange(aes(group = group,
                      color = group,
                      shape = group),
                  position = position_dodge(width = 0.5), size = 0.3) +
  theme(legend.position = "top") +
  labs(x = "Perceived costs of sanctions", 
       y = "", 
       color = "Group",
       shape = "Group") +
  geom_vline(xintercept = 0.0, color = "gray") +
  scale_color_manual(values = c("#00008b", "maroon"))  +
  scale_x_continuous(breaks=seq(1,7,1)) +
  xlim(1,7) +
  coord_flip() +
  geom_vline(xintercept = 4.735770, color = "maroon", linetype="dotted") +
  geom_vline(xintercept = 4.520299, color = "#00008b", linetype="dotted") +
  scale_shape_manual(values=c(16, 15)) 

ggsave("DE_costs_anchor.jpg",
       height = 8,
       width = 8,
       scale = 0.5)

#### Additional information anchor: Support for sanctions

##### Additional information anchor: Support for sanctions - Poland (Figure A20)

pl_support <- lm(formula = support_info_provision ~ treatment_information_provision * treatment_anchor, 
                 data = pl,
                 weights = weight)

plot_model(pl_support, type = "int")

pl_support_retrieve <- plot_model(pl_support, type = "int")

pl_support_df <- data.frame(level2 = pl_support_retrieve[["plot_env"]][["x"]][["x"]],
                            estimate = pl_support_retrieve[["plot_env"]][["x"]][["predicted"]],
                            lower = pl_support_retrieve[["plot_env"]][["x"]][["conf.low"]],
                            higher = pl_support_retrieve[["plot_env"]][["x"]][["conf.high"]],
                            group = pl_support_retrieve[["plot_env"]][["x"]][["group"]])

pl_support_df <- pl_support_df %>% mutate(level = ifelse(level2==1, "Control",
                                                         ifelse(level2==2, "Information",
                                                                ifelse(level2==3, "Information \n + COVID-19",
                                                                       ifelse(level2==4, "Information \n + Russia", NA))))) 

ggplot(pl_support_df,
       mapping = aes(x = estimate,
                     y = level,
                     xmin = lower,
                     xmax = higher)) +
  theme_bw() +
  geom_pointrange(aes(group = group,
                      color = group,
                      shape = group),
                  position = position_dodge(width = 0.5), size = 0.3) +
  theme(legend.position = "top") +
  labs(x = "Support for sanctions", 
       y = "", 
       color = "Group",
       shape = "Group") +
  geom_vline(xintercept = 0.0, color = "gray") +
  scale_color_manual(values = c("#00008b", "maroon"))  +
  scale_x_continuous(breaks=seq(1,7,1)) +
  xlim(1,7) +
  coord_flip() +
  geom_vline(xintercept = 5.015639, color = "maroon", linetype="dotted") +
  geom_vline(xintercept = 4.936789, color = "#00008b", linetype="dotted") +
  scale_shape_manual(values=c(16, 15)) 

ggsave("PL_support_anchor.jpg",
       height = 8,
       width = 8,
       scale = 0.5)

##### Additional information anchor: Support for sanctions - Germany (Figure A19)

de_support <- lm(formula = support_info_provision ~ treatment_information_provision * treatment_anchor, 
                 data = de,
                 weights = weight)

plot_model(de_support, type = "int")

de_support_retrieve <- plot_model(de_support, type = "int")

de_support_df <- data.frame(level2 = de_support_retrieve[["plot_env"]][["x"]][["x"]],
                            estimate = de_support_retrieve[["plot_env"]][["x"]][["predicted"]],
                            lower = de_support_retrieve[["plot_env"]][["x"]][["conf.low"]],
                            higher = de_support_retrieve[["plot_env"]][["x"]][["conf.high"]],
                            group = de_support_retrieve[["plot_env"]][["x"]][["group"]])

de_support_df <- de_support_df %>% mutate(level = ifelse(level2==1, "Control",
                                                         ifelse(level2==2, "Information",
                                                                ifelse(level2==3, "Information \n + COVID-19",
                                                                       ifelse(level2==4, "Information \n + Russia", NA))))) 

ggplot(de_support_df,
       mapping = aes(x = estimate,
                     y = level,
                     xmin = lower,
                     xmax = higher)) +
  theme_bw() +
  geom_pointrange(aes(group = group,
                      color = group,
                      shape = group),
                  position = position_dodge(width = 0.5), size = 0.3) +
  theme(legend.position = "top") +
  labs(x = "Support for sanctions", 
       y = "", 
       color = "Group",
       shape = "Group") +
  geom_vline(xintercept = 0.0, color = "gray") +
  scale_color_manual(values = c("#00008b", "maroon"))  +
  scale_x_continuous(breaks=seq(1,7,1)) +
  xlim(1,7) +
  coord_flip() +
  geom_vline(xintercept = 3.996341, color = "maroon", linetype="dotted") +
  geom_vline(xintercept = 4.187164, color = "#00008b", linetype="dotted") +
  scale_shape_manual(values=c(16, 15)) 

ggsave("DE_support_anchor.jpg",
       height = 8,
       width = 8,
       scale = 0.5)

#### END #### END #### END #### END #### END #### END ####
